var app = getApp();
Component({
    properties: {
        oid : String,
        name : String,
    },
    data:{
        status:0,
        fee : 0,
        oid : '',
        isshow : false,
        chouing : false,
    },
    options : {
        addGlobalClass : true,
    },
    methods: {
	    showhb : function(oid,fee){
	        var self = this;
	        self.setData({
	            status : 0,
	            fee : fee,
	            oid : oid,
	            isshow : true,
	        })
	    },
	    getprize(){
	        var self = this;
	        if( self.data.chouing || self.data.status == 1 ) return false;
	        self.data.chouing = true;
	        var postdata = {
	        	op : 'getchb',
	        	oid : self.data.oid,
	        }
	        app.com.http('order','POST',postdata,0,true,'','',function(res){
	            if ( res.data && !res.data.errno && res.data.errno !== undefined) {
	                self.setData({
	                	status : 1,
	                })
	                app.com.toast(res.data.message);
	                self.triggerEvent('paychbed');
	            }else{
	                app.com.alert(res.data.message);
	            }
	            self.data.chouing = false;
	        });
	    },
	    close : function(){
	        this.setData({
	            isshow : false,
	        });
	        this.triggerEvent('paychbed');
	    },
	    navigateto(e){
	    	app.com.navigateto( e );
	    }
    }

})